Current Location: Home> Function Categories> log

log

Natural logarithm
Name:log
Category:math
Programming Language:php
One-line Description:Natural logarithm.

Definition and usage

log() returns natural logarithm.

Example

 <?php
echo lcg_value ( ) ;
?>

Try it yourself

grammar

 log ( x , base )
parameter describe
x Required. A number.
base Optional. If this parameter is specified, log base x is returned.

illustrate

If an optional parameter base is specified, log() returns log base x , otherwise log() returns the natural logarithm of parameter x .

Note: The parameter base is available since PHP 4.3.0. You can calculate any logarithm with n based on b, but in fact, you use the mathematical equation: logb(n) = log(n)/log(b), where log is a natural logarithm.

Similar Functions
  • Antihyperbolic tangent atanh

    atanh

    Antihyperbolictangen
  • Convert radians to corresponding angles rad2deg

    rad2deg

    Convertradianstocorr
  • Sine sin

    sin

    Sine
  • Find the minimum value min

    min

    Findtheminimumvalue
  • Calculate the oblique length of a straight triangle hypot

    hypot

    Calculatetheobliquel
  • Returns exp(number) - 1, and can calculate the exact result even when the value of number is close to zero. expm1

    expm1

    Returnsexp(number)-1
  • Square root sqrt

    sqrt

    Squareroot
  • Perform floating point division under IEEE 754 semantics fdiv

    fdiv

    Performfloatingpoint
Popular Articles